package com.vivo.tool.eclipsestarter;

import java.awt.BorderLayout;
import java.util.ArrayList;

import javax.swing.WindowConstants;

/**
 * This code was generated using CloudGarden's Jigloo SWT/Swing GUI Builder, which is free for non-commercial use. If Jigloo is being used commercially (ie, by a corporation, company or business for
 * any purpose whatever) then you should purchase a license for each developer using Jigloo. Please visit www.cloudgarden.com for details. Use of Jigloo implies acceptance of these licensing terms.
 * ************************************* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED for this machine, so Jigloo or this code cannot be used legally for any corporate or commercial purpose.
 * *************************************
 * 
 * @author vivo
 * @version 0.13
 */
public class StarterMain extends javax.swing.JFrame {

	private static final long serialVersionUID = 1L;

	private StatusPanelBean statusPanelBean1;
	private CenterPanelBean centerPanelBean1;

	/**
	 * Returns the singleton instance.
	 * 
	 * @return the singleton instance
	 */
	public static StarterMain getInstance() {
		if (instance == null) {
			instance = new StarterMain();
		}
		return instance;
	}

	/**
	 * Holds singleton instance
	 */
	private static StarterMain instance;

	public StarterMain() {
		super();
		initGUI();
		initProgram();
	}

	private void initGUI() {
		try {
			BorderLayout thisLayout = new BorderLayout();
			this.getContentPane().setLayout(thisLayout);
			this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
			{
				statusPanelBean1 = new StatusPanelBean();
				this.getContentPane().add(statusPanelBean1, BorderLayout.SOUTH);
				statusPanelBean1.setPreferredSize(new java.awt.Dimension(579, 20));
				this.getContentPane().add(statusPanelBean1, BorderLayout.SOUTH);
			}
			{
				centerPanelBean1 = new CenterPanelBean();
				this.getContentPane().add(centerPanelBean1, BorderLayout.CENTER);
				this.getContentPane().add(centerPanelBean1, BorderLayout.CENTER);
			}
			pack();
			this.setSize(622, 492);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * display this JFrame
	 */
	public static void main(String[] args) {
		StarterMain.getInstance().setVisible(true);
	}

	/**
	 * initial the programme
	 */
	private void initProgram() {
		// Tool.setStatusString("Initializing...");
		// get plugin list.
		ArrayList al = LinkFileManager.getPluginList(Constant.strPluginPath, centerPanelBean1
				.isjcbReGenerateLinkFileSelected());
		centerPanelBean1.setPluginListCheckBoxPanel(al);
		// Tool.setStatusString("Loading Plugin Suit");
		centerPanelBean1.loadPluginSuit();
		// Tool.setStatusString("Initializing...done.");
	}

	/**
	 * @return Returns the centerPanelBean1.
	 */
	public CenterPanelBean getCenterPanelBean1() {
		return centerPanelBean1;
	}

	/**
	 * @return Returns the statusPanelBean1.
	 */
	public StatusPanelBean getStatusPanelBean1() {
		return statusPanelBean1;
	}

}
